# SPDX-License-Identifier: GPL-2.0
#
# Makefile for Kernel-based Virtual Machine module, HYP part
#
ifdef CONFIG_RTOS_HCFI
ifdef CONFIG_CC_IS_GCC
        cflags-$(CONFIG_KVM)    += -fplugin-arg-hcfi_plugin-tagonly
endif
ifdef CONFIG_CC_IS_CLANG
        cflags-$(CONFIG_KVM)    += -fhcfi-tagonly
endif
        KBUILD_CFLAGS           += $(cflags-y)
endif

incdir := $(srctree)/$(src)/include
subdir-asflags-y := -I$(incdir)
subdir-ccflags-y := -I$(incdir)				\
		    -fno-stack-protector		\
		    -DDISABLE_BRANCH_PROFILING		\
		    $(DISABLE_STACKLEAK_PLUGIN)

obj-$(CONFIG_KVM) += vhe/ nvhe/ pgtable.o smccc_wa.o

ifdef CONFIG_EULEROS_VIRTUAL
ifeq ($(CONFIG_KERNEL_MODE_NEON),y)

ifeq ($(ARCH),arm)
  CFLAGS_neon.o                        += -march=armv8-a -mfloat-abi=softfp -mfpu=neon
endif
ifeq ($(ARCH),arm64)
  CFLAGS_REMOVE_neon.o         += -mgeneral-regs-only
endif

CFLAGS_neon.o += -ffreestanding
obj-$(CONFIG_KVM) += neon.o

endif
endif
